<?php
declare(strict_types=1);
namespace cms\exam\api_controller;
use cms\exam\service\AppService;
use cms\system\api_controller\AbstractController;
use Hyperf\Database\Model\ModelNotFoundException;
use Hyperf\Di\Annotation\Inject;

class CommonController extends AbstractController
{
    /**
     * @Inject()
     * @var AppService
     */
    protected AppService $appService;

    /**
     * @param false $force
     * @param string $input
     * @return null
     */
    protected function _getApp(bool $force = false, string $input = 'app_id')
    {
        $app_id = (int) $this->request->input($input, 0);
        return $this->appService->getDataById($app_id, $force);
    }
}
